package com.tg.data.http.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class TimeActionBean implements Parcelable {
    public int size;
    public ClockTimeBean from = new ClockTimeBean();
    public ClockTimeBean to = new ClockTimeBean();
    public short state;
    public short repeat;
    public int action;

    public short oldState;

    public  TimeActionBean(){}

    protected TimeActionBean(Parcel in) {
        size = in.readInt();
        from = in.readParcelable(ClockTimeBean.class.getClassLoader());
        to = in.readParcelable(ClockTimeBean.class.getClassLoader());
        state = (short) in.readInt();
        repeat = (short) in.readInt();
        action = in.readInt();
        oldState = (short) in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(size);
        dest.writeParcelable(from, flags);
        dest.writeParcelable(to, flags);
        dest.writeInt((int) state);
        dest.writeInt((int) repeat);
        dest.writeInt(action);
        dest.writeInt((int) oldState);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<TimeActionBean> CREATOR = new Creator<TimeActionBean>() {
        @Override
        public TimeActionBean createFromParcel(Parcel in) {
            return new TimeActionBean(in);
        }

        @Override
        public TimeActionBean[] newArray(int size) {
            return new TimeActionBean[size];
        }
    };
}
